package com.User.Userservice.Controller;

import com.User.Userservice.POJO.Result;
import com.User.Userservice.POJO.User;
import com.User.Userservice.Server.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping
    public Result UserSave(@RequestBody User user) {
        User user1 =  userService.save(user);
        return Result.success(user1);
    }



}
